package t_1893

func isCovered(ranges [][]int, left int, right int) bool {
	labels := [52]int{0}
	for i := 0; i < len(ranges); i++ {
		labels[ranges[i][0]]++
		labels[ranges[i][1]+1]--
	}

	cur := 0
	for i := 1; i <= 50; i++ {
		cur += labels[i]
		if i >= left && i <= right && cur <= 0 {
			return false
		}
	}

	return true
}
